﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Restaurant.DTO;
using Restaurant.DAO;
using System.Data;



namespace Restaurant.BUS
{
    public class KhoService
    {
        private KhoBD httDAO = new KhoBD();

        public DataTable LayKho()
        {
            return httDAO.LayKho();
        }

        public DataTable LayKhoTheoMa(int ma)
        {
            //DataTable dbtab = httDAO.LayNguyenLieuTheoMa(ma);
            //DataRow dbrow = dbtab.Rows[0];
            //return dbrow[1].ToString();
            return httDAO.LayKhoTheoMa(ma);
        }

        public DataTable LayKhoTheoNH(int ma)
        {
            return httDAO.LayKhoTheoNH(ma);
        }

        public bool ThemKho(string TenKho, int SucChua, int MaNH)
        {
            if (TenKho == "")
            {
                return false;
            }
            if (httDAO.ThemKho(TenKho,SucChua,MaNH))
                return true;
            return false;
        }

        public bool XoaKho(int ma)
        {
            if (httDAO.XoaKho(ma))
                return true;
            return false;
        }

        public bool SuaKho(int MaKho, string Ten, int SucChua, int MaNH)
        {
            if (httDAO.SuaKho(MaKho,Ten,SucChua,MaNH))
                return true;
            return false;
        }
    }
}
